<?php

	class Session{
		
		public function __construct(){
			if(!isset($_SESSION)){
				session_start();
			}
		}
		public function login($uid = false, $utype = false){
			$_SESSION['login'] = true;
			$uid && $this->setUserId($uid);
			$utype && $this->setUserType($utype);
		}
		public function logout(){
			session_destroy();
		}
		public function setUserId($var){
			$_SESSION['uid'] = $var;
		}
		public function setUserType($var){
			$_SESSION['utype'] = $var;
		}
		
		public function getUserType(){
			return $_SESSION['utype'];
		}
		public function getUserId(){
			return $_SESSION['uid'];
		}
		
	}
	
?>